package com.aegis.spring;

import com.aegis.spring.config.AegisAppProperties;
import com.aegis.spring.config.AegisUserProperties;
import com.aegis.spring.config.SaInitConfig;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;

/**
 * @Author wuweixin
 *
 * @Version 1.0
 * @Descritube
 */
@EnableConfigurationProperties({AegisUserProperties.class, AegisAppProperties.class})
public class AegisBeanRegister {


    @Bean
    @ConditionalOnMissingBean
    public AegisInitializer aegisInitializer(AegisUserProperties aegisUserProperties) {
        return new AegisInitializer(aegisUserProperties.getAppId());
    }


    @Bean
    public SaInitConfig saConfig() {
        return new SaInitConfig();
    }


}
